<ion-view title="我要补单">
    <ion-nav-buttons side="left">
        <button class="button back-button buttons icon ion-ios-arrow-left button-clear header-item" nav-direction="back" ui-sref="menu">返回</button>
    </ion-nav-buttons>
    <ion-nav-buttons side="right">
        <button class="button button-icon icon ion-image" ng-click="actionSheet()"></button>
    </ion-nav-buttons>
    <ion-content>
        <div class="list list1 card">
            <div ng-if="imgData!=undefined" ng-repeat="img in imgData" style="position:relative;width: 32.5%;height: 100px;float:left;">
                <img style="width: 100%;height: 100%;" ng-src="{{img}}"/>
                <i class="icon ion-close-circled" ng-click="deleteImg(img)" style="position:absolute;top:0;right:0;color: #69717d;"></i>
            </div>
            <label class="item item-input div">
                &nbsp;<i class="input-label  col-25" >承运日期：</i>
                <button class="button button-block button-clear " style="text-align: right;font-size: 14px;margin-right: 42px;color: black" ng-click="showStartDate()">{{cyrq | date : "yyyy年MM月dd日"}}</button>
            </label>
            <div class="item item-input div">
                <i class="icon ion-asterisk assertive bitian" style="margin-left: -9px"></i>承运单号：
                <input type="text" onkeyup="value=value.replace(/[^\w\-\/]/ig,'')"  ng-model="buDan.cydh" class="rightTxt" maxlength="15" id="cydhCode">
            </div>
            <div class="item item-input div">
                <i class="icon ion-asterisk assertive bitian" style="margin-left: -9px"></i>物流公司：
                <input type="text" ng-model="buDan.dwmc" class="rightTxt" maxlength="15" id="dwmc">
            </div>
            <div class="item item-input item-divider div">
                <i class="ion ion-person i balanced ti"></i>
                <i class="dark">发货信息</i>
            </div>
            <div class="item item-input div ">
                <input type="text"  ng-model="buDan.fhrmc" placeholder="姓名" maxlength="8">
                <i style="color: #9f9f9f">丨</i>
                <input type="tel" class="col-30" ng-model="buDan.fhrdh" placeholder="电话" maxlength="11" onkeyup="value=value.replace(/\D/g,'')">
            </div>
            <div class="item item-input div" style="padding-left: 5px;">
                <div class="row  icon-left icon-right ">
                    <select id="provincef" class="proCity">
                        <option>地区选择</option>
                        <option ng-repeat="pros in provinces" value="{{pros.code}}">{{pros.name}}</option>
                    </select>
                    <i style="color: #9f9f9f">丨</i>
                    <select id="cityf" class="proCity">
                        <option ng-repeat="cit in citiesF" value="{{cit.code}}">{{cit.name}}</option>
                    </select>
                    <i style="color: #9f9f9f">丨</i>
                    <select id="areaf" class="proCity">
                        <option ng-repeat="are in areasF" value="{{are.code}}">{{are.name}}</option>
                    </select>
                </div>
            </div>
            <div class="item item-input div">
                <input type="text" ng-model="buDan.fhrdz" placeholder="详细地址" maxlength="50">
            </div>
            <div class="item item-input item-divider div" ng-click="chooseShr(2)">
                <i class="ion ion-person i energized ti"></i>
                <i class="dark">收货信息</i>
                <i class="ion ion-ios-paper-outline" style="margin-left: auto;color: #8f8f8f;margin-right: 10px;font-size: 23px;"></i>
            </div>
            <div class="item item-input div ">
                <input type="text"  ng-model="buDan.shrmc" placeholder="姓名" maxlength="8">
                <i style="color: #9f9f9f">丨</i>
                <input type="tel" maxlength="11"  class="col-30" ng-model="buDan.shrdh" placeholder="电话" onkeyup="value=value.replace(/\D/g,'')">
            </div>
            <div class="item item-input div" style="padding-left: 5px;">
                <div class="row  icon-left icon-right ">
                    <select id="provinces" class="proCity">
                        <option>地区选择</option>
                        <option ng-repeat="pros in provinces" value="{{pros.code}}">{{pros.name}}</option>
                    </select>
                    <i style="color: #9f9f9f">丨</i>
                    <select id="citys" class="proCity">
                        <option ng-repeat="cit in citiesS" value="{{cit.code}}">{{cit.name}}</option>
                    </select>
                    <i style="color: #9f9f9f">丨</i>
                    <select id="areas" class="proCity">
                        <option ng-repeat="are in areasS" value="{{are.code}}">{{are.name}}</option>
                    </select>
                </div>
            </div>
            <div class="item item-input div">
                <input type="text" ng-model="buDan.shrdz" placeholder="详细地址" maxlength="50">
            </div>
            <div class="item item-input item-divider div">
                <i class="ion ion-ios-list i calm ti"></i>
                <i class="dark">货物信息</i>
            </div>
            <div class="item item-input div">
                <div class="row">
                    <i class="input-label">货名：</i>
                    <input type="text" ng-model="buDan.hwmc" class="rightTxt" maxlength="10">
                </div>
            </div>
            <div class="item item-input div" style="margin-left: 5px;">件数：
                <input type="number" ng-model="buDan.sl" ng-change="changejian(buDan.sl)" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" class="rightTxt" style="margin-right: -25px"  id="jian" onkeypress="this.value = this.value.slice(0, 6)">
                <span style="color: darkgrey;margin-right: 13px;">件</span>
            </div>
            <div class="item item-input div" style="margin-left: 5px;">重量：
                <input type="number" ng-model="buDan.zl" class="rightTxt zlDot" style="margin-right: -25px"  id="zl" onkeypress="this.value = this.value.slice(0, 7)">
                <span style="color: darkgrey;margin-right: 13px;">吨</span>
            </div>
            <div class="item item-input div" style="margin-left: 5px;">体积：
                <input type="number" ng-model="buDan.tj" class="rightTxt tjDot" style="margin-right: -25px"  id="tj" onkeypress="this.value = this.value.slice(0, 7)">
                <span style="color: darkgrey;margin-right: 13px;">㎥</span>
            </div>
            <div class="item item-input div">
                <div class="row">
                    <i class="input-label">包装：</i>
                    <input type="text" ng-model="buDan.bzlx" class="rightTxt">
                </div>
            </div>
            <div class="item item-input item-select div" >
                <div class="row  icon-left icon-right ">
                    <i class="input-label">送货方式：</i>
                    <select class="select" id="shfs">
                        <option ng-repeat="i in shfs" value="{{i.code}}">{{i.name}}</option>
                    </select>
                </div>
            </div>
            <div class="item item-input item-divider div">
                <i class="ion ion-cash assertive ti"></i>&nbsp;&nbsp;&nbsp;
                <i style="height: 30px;line-height: 30px">费用:</i>
                <button class=" button-clear col-80" style="text-align: right;padding-right: 20px" ng-click="addMenu()"><i class="icon ion-plus-round dark"></i></button>
            </div>
            <div class="item item-input item-select div" >
                <div class="row  icon-left icon-right ">
                    <i class="input-label">付款方式：</i>
                    <select class="select" id="fkType" >
                        <option ng-repeat="i in fkfs" value="{{i.code}}">{{i.name}}</option>
                    </select>
                </div>
            </div>
            <div class="item item-input hide div" id="xfLab">
                <div class="row">
                    <i class="input-label " >现付：</i>
                    <input type="number" ng-model="buDan.yf_xf" class="rightTxt xfDot"  id="yfxf" onkeypress="this.value = this.value.slice(0, 9)">
                </div>
            </div>
            <div class="item item-input hide div" id="tfLab">
                <div class="row">
                    <i class="input-label">提付：</i>
                    <input type="number" ng-model="buDan.yf_tf" class="rightTxt tfDot"  id="yftf" onkeypress="this.value = this.value.slice(0, 9)">
                </div>
            </div>
            <div class="item item-input hide div" id="hfLab">
                <div class="row">
                    <i class="input-label">回付：</i>
                    <input type="number" ng-model="buDan.yf_hf" class="rightTxt hfDot" id="yfhf" onkeypress="this.value = this.value.slice(0, 9)">
                </div>
            </div>
            <div class="item item-input hide div" id="yjLab">
                <div class="row">
                    <i class="input-label">月结：</i>
                    <input type="number" ng-model="buDan.yf_yj" class="rightTxt yjDot" id="yfyj" onkeypress="this.value = this.value.slice(0, 9)">
                </div>
            </div>
            <div class="item item-input hide div" id="dkLab">
                <div class="row">
                    <i class="input-label">代扣：</i>
                    <input type="number" ng-model="buDan.yf_ycdk" class="rightTxt dkDot" id="yfdk" onkeypress="this.value = this.value.slice(0, 9)">
                </div>
            </div>
            <div class="item item-input div" id="yun" >
              <div class="row">
                <i class="input-label ">运费：</i>
                <input type="number" ng-model="buDan.yf" id="yf" class="rightTxt numDot" onkeypress="this.value = this.value.slice(0, 9)">
              </div>
            </div>
            <div class="item item-input div">
                <div class="row">
                    <i class="input-label ">代收货款：</i>
                    <input type="number" ng-model="buDan.dsk_hf" class="rightTxt dshkDot"  id="dskhf" onkeypress="this.value = this.value.slice(0, 9)">
                </div>
            </div>
            <div class="item item-input div">
                <div class="row">
                    <i class="input-label ">现返：</i>
                    <input type="number" ng-model="buDan.xxf_xf" class="rightTxt xxfDot"  id="xf" onkeypress="this.value = this.value.slice(0, 9)">
                </div>
            </div>
            <div class="item item-input div">
                <div class="row">
                    <i class="input-label ">欠返：</i>
                    <input type="number" ng-model="buDan.xxf_qf" class="rightTxt qfDot"  id="qf" onkeypress="this.value = this.value.slice(0, 9)">
                </div>
            </div>
            <div class="item item-input div">
                <div class="row">
                    <i style="margin-top: 9px">回单否</i>
                    <label class="toggle" style="margin-left: auto;">
                        <input type="checkbox" ng-model="buDan.isHd">
                        <div class="track">
                            <div class="handle"></div>
                        </div>
                    </label>
                </div>
            </div>
            <div class="item item-input hide div" on-hold="holdonRemove(1)" id="shfLab">
                <div class="row">
                    <i class="input-label">送货费：</i>
                    <input type="number" ng-model="buDan.shf" class="rightTxt shfDot"  id="shf" onkeypress="this.value = this.value.slice(0, 9)">
                </div>
            </div>
            <div class="item item-input hide div" on-hold="holdonRemove(2)" id="thfLab">
                <div class="row">
                    <i class="input-label">提货费：</i>
                    <input type="number" ng-model="buDan.thf" class="rightTxt thfDot" id="thf" onkeypress="this.value = this.value.slice(0, 9)">
                </div>

            </div>
            <div class="item item-input hide div" on-hold="holdonRemove(3)" id="beLab">
                <div class="row">
                    <i class="input-label col-5">保额：</i>
                    <input type="number"class="col-55 beDot" ng-model="buDan.be"  id="be" onkeypress="this.value = this.value.slice(0, 9)">
                    <i style="margin-top: 9px">投保否</i>
                    <ion-checkbox id="ckTb" style="height: 42px;margin-top: -2px" ng-model="buDan.isCk"></ion-checkbox>
                </div>
            </div>
            <div class="item item-input hide div" on-hold="holdonRemove(4)" id="bfLab">
                <div class="row">
                    <i class="input-label">保费：</i>
                    <input type="number" ng-model="buDan.bf" class="rightTxt bfDot" id="bf" onkeypress="this.value = this.value.slice(0, 9)">
                </div>

            </div>
            <div class="item item-input hide div" on-hold="holdonRemove(5)" id="yfdfLab">
                <div class="row">
                    <i class="input-label">运费垫付：</i>
                    <input type="number" ng-model="buDan.yf_df" class="rightTxt yfdfDot" id="yfdf" onkeypress="this.value = this.value.slice(0, 9)" >
                </div>

            </div>
            <div class="item item-input hide div" on-hold="holdonRemove(6)" id="dskdfLab">
                <div class="row">
                    <i class="input-label">代收款垫付：</i>
                    <input type="number" ng-model="buDan.dsk_xf" class="rightTxt dskdfDot"  onkeypress="this.value = this.value.slice(0, 9)"  id="dskxf">
                </div>
            </div>
            <div class="item item-input div">
                <div class="row">
                    <i class="input-label col-5">备注：</i>
                    <input type="text" ng-model="buDan.bz" maxlength="30">
                </div>
            </div>
        </div>
    </ion-content>
    <ion-footer-bar style="height: 50px;text-align: center;">
        <a class="button button-positive save" style="width: 99%;" id="saveBd" ng-click="saveCyd()">保存</a>
    </ion-footer-bar>
</ion-view>
